Setting up a password login for switches and routers is a critical security measure. By setting up in network devices can enhance the security and prevent from unauthorized access.
In a Cisco router or switch, there are 2 password should be set up (console and virtual terminal line). This can have an extra security for the devices. Moreover, cisco routers and switches also provide password encryption service, minimum password length and block login setting for extra security.
The figure above shows the configuration of password security on a Cisco router. The first password is for the console line, and the second password is for the virtual terminal line when the user enters privileged EXEC mode.
By default, all the passwords configured are store in clear-text. It means that user can view the passwords directly with the command show run.
To overcome this, the clear-text can be encrypted with the command service password-encryption.
(config)# service password encryption
(config)# security password min-length [number]
(config)# login block-for [seconds] attempts [number] within [seconds]
(config)# line console/vty [start number of line] [end number of line]
(config-line)# password [your password]
(config-line)# login
# show run